package com.songtech.base.common;

import com.github.pagehelper.PageInfo;

public class JsonResult {

	/**返回编码1、成功；0、失败*/
	public int status;
	
	/** layui前端解析需要code字段为0，和业务无关*/
	public int code = 0;
	
	/** 返回信息*/
	public String msg;
	
	/** 返回数据*/
	public Object data;
	
	public JsonResult() {
	}
	
	/**
	 * 构造函数
	 * @param page
	 */
	public JsonResult(Object data) {
		this.data = data;
	}
	
	/**
	 * 构造函数
	 * @param page
	 */
	public JsonResult(Object data, int status, String msg) {
		this.data = data;
		this.status = status;
		this.msg = msg;
	}
	
	/**
	 * 设置count和data
	 * @param page
	 */
	public void setJsonResultPage(PageInfo<?> page){
		this.data = page;
	}
	
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	
	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "JsonResult [status=" + status + ", msg=" + msg + ", data=" + data + "]";
	}
}
